package com.colorful.insuranceproject.bean;

import android.os.Parcel;

/**
 * 第三方登陆数据包装类
 * Created by lovely3x on 15-9-24.
 */
public class ThirdUser extends UserInfo {

    private String account;//三方唯一标识
    private int type;//三方登录类型 1：微信 2：qq  3：微博
    private String nickname;//昵称
    private String headimg;//头像地址
    private int sex;//性别  1：男  2：女
    private String token;//token值
    private String openId;//

    public ThirdUser() {
    }

    public ThirdUser(String account, int type, String nickname, String headimg, int sex, String token, String openId) {
        this.account = account;
        this.type = type;
        this.nickname = nickname;
        this.headimg = headimg;
        this.sex = sex;
        this.token = token;
        this.openId = openId;
    }


    public ThirdUser(Parcel in, String account, int type, String nickname, String headimg, int sex, String token, String openId) {
        super(in);
        this.account = account;
        this.type = type;
        this.nickname = nickname;
        this.headimg = headimg;
        this.sex = sex;
        this.token = token;
        this.openId = openId;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    @Override
    public int getType() {
        return type;
    }

    @Override
    public void setType(int type) {
        this.type = type;
    }

    @Override
    public String getNickname() {
        return nickname;
    }

    @Override
    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getHeadimg() {
        return headimg;
    }

    public void setHeadimg(String headimg) {
        this.headimg = headimg;
    }

    @Override
    public int getSex() {
        return sex;
    }

    @Override
    public void setSex(int sex) {
        this.sex = sex;
    }

    @Override
    public String getToken() {
        return token;
    }

    @Override
    public void setToken(String token) {
        this.token = token;
    }

    public String getOpenId() {
        return openId;
    }

    public void setOpenId(String openId) {
        this.openId = openId;
    }

    public String typeToString() {
        //三方登录类型 1：微信 2：qq  3：微博
        switch (type) {
            case 1:
                return "WeChat";
            case 2:
                return "QQ";
            case 3:
                return "Sina";
        }
        return "Unknown";
    }

    @Override
    public String toString() {
        return "ThirdUser{" +
                "account='" + account + '\'' +
                ", type=" + type +
                ", nickname='" + nickname + '\'' +
                ", headimg='" + headimg + '\'' +
                ", sex=" + sex +
                ", token='" + token + '\'' +
                ", openId='" + openId + '\'' +
                '}';
    }
}
